using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class TL_JunctionMap : EntityTypeConfiguration<TL_Junction>
    {
        public TL_JunctionMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.ID_A)
                .HasMaxLength(20);

            this.Property(t => t.ID_B)
                .HasMaxLength(20);

            this.Property(t => t.Type)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("TL_Junction");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.ID_A).HasColumnName("ID_A");
            this.Property(t => t.ID_B).HasColumnName("ID_B");
            this.Property(t => t.Type).HasColumnName("Type");
        }
    }
}
